package client.control;

import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.scene.text.Text;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.KeyCode;
import client.client;

public class LoginController {
	@FXML TextField usernameField;
	@FXML PasswordField passwordField;
	@FXML Button loginBtn;
	@FXML Button regBtn;
	@FXML Button accBtn;
	@FXML Button setBtn;

	@FXML public void set(ActionEvent event){
		c.set();
	}

	@FXML public void login(ActionEvent event){
		c.login();
	}

	@FXML public void register(ActionEvent event){
		c.register();
	}

	@FXML public void accm(ActionEvent event){
		c.acc();
	}

	client c;

	public void setC(client c){
		this.c = c;
	}

	public void readySet(){
		setBtn.setDisable(false);
		loginBtn.setDisable(true);
		regBtn.setDisable(true);
		accBtn.setDisable(true);
	}

	public void readyGo(){
		setBtn.setDisable(true);
		loginBtn.setDisable(false);
		regBtn.setDisable(false);
		accBtn.setDisable(false);
	}

	public String getUser(){
		return usernameField.getText();
	}

	public String getPass(){
		return passwordField.getText();
	}

	public void hide(){
		loginBtn.getScene().getWindow().hide();
	}
}